﻿@model Himall.Model.ProductCircleInfo
@{
	ViewBag.Title = "商品编辑";
	ViewBag.IsEdit = true;
}

@section Styles
{
	<link href="~/Areas/SellerAdmin/Content/product.css" rel="stylesheet" />
	<link href="~/Content/bootstrap-datetimepicker.min.css" rel="stylesheet" />
}
<style>
    .form-horizontal{padding:0;}
</style>
<form id="editForm" method="post">
    <input name="CircleId" type="hidden" value="@Model.CircleId" />
    <input name="ProductId" type="hidden" value="@Model.ProductId" />
    <div class="container Sclear-B">
        <ul class="nav nav-tabs-custom clearfix">
            <li class="@(Model.CircleId == 0 ? "active" : "")"><a href="/SellerAdmin/Product/CircleEdit/@Model.ProductId">新增</a></li>
            <li class="@(Model.CircleId == 0 ? "" : "active")"><a href="/SellerAdmin/Product/CircleList/@Model.ProductId">修改</a></li>
        </ul>
        <div class="form-horizontal">
            <div class="pro-info clearfix">
                <div class="pro-info-right pro-attr-right">
                    <div class="form-group">
                        <div class="col-sm-10 des">
                            <!-- Nav tabs -->
                            <ul class="nav nav-tabs">
                                <li class="active"><a style="padding:8px 20px; cursor: pointer;">PC端</a></li>
                                <li class="mdes"><a style="padding:8px 20px; cursor: pointer;">移动端</a></li>
                            </ul>

                            <!-- Tab panes -->
                            <div class="tab-content">
                                <div class="tab-pane active">
                                    <script id="desContainer" name="Description" type="text/plain" style="width:100%; height:250px;">@Html.Raw(Model.Description)</script>
                                </div>
                                <div class="tab-pane">
                                    <script id="mdesContainer" name="MobileDescription" type="text/plain" style="width:100%; height:250px;">@Html.Raw(Model.MobileDescription)</script>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="pro-detail-btn clearfix">
                <input id="submit" class="btn btn-default Sclear-P71 fr" type="submit" value="保存" />
            </div>
        </div>
    </div>
</form>




@section Scripts
{
	<script src="~/Scripts/jquery.validate.js"></script>
	<script src="~/Scripts/jquery.validate.unobtrusive.js"></script>
	<script src="~/Scripts/ueditor/ueditor.config.js"></script>
	<script src="~/Scripts/ueditor/ueditor.all.min.js"></script>
	<script src="~/Scripts/bootstrap-datetimepicker.js"></script>
	<script src="~/Scripts/bootstrap-datetimepicker.zh-CN.js"></script>
    <script>
        $(function () {
            var $form = $('form:first');

            //初始化富文本框
            UE.getEditor('desContainer');
            UE.getEditor('mdesContainer');

            //详情描术选项卡切换
            $('.nav.nav-tabs li').click(function () {
                var li = $(this);
                if (li.hasClass('active'))
                    return;
                li.parent().children('li').toggleClass('active');
                li.parent().next('.tab-content').children('.tab-pane').toggleClass('active');
            });
            $form.on('submit', function () {
                var loading = showLoading();
                $form.ajaxSubmit({
                    success: function (data) {
                        loading.close();
                        if (data) {
                            if (data.success == true) {
                                $.dialog.succeedTips('操作成功！');
                                setTimeout(function () {
                                    location.href = '/SellerAdmin/product/management';
                                }, 1500);
                            } else {
                                $.dialog.errorTips(data.message);
                            }
                        } else {
                            $.dialog.errorTips('操作失败！');
                        }
                    },
                    error: function (data) {
                        loading.close();
                        $.dialog.errorTips('操作失败！');
                    }
                });

                return false;
            });
        });
    </script>
}